From: Jonas Dreßler Date: Fri, 5 Mar 2021 11:28:39 +0000 (+0100) Subject: st/shadow: Add a fast path to comparisons X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~9 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3b4a1fcd51c087bb242fe3f8e3bd7a1280bd0aa9;p=gnome-shell.git st/shadow: Add a fast path to comparisons We do this in most places in St, it's consistent to do it here, too. Part-of: --- diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c index ab3eaa856..0a8e319ad 100644 --- a/src/st/st-shadow.c +++ b/src/st/st-shadow.c @@ -126,6 +126,9 @@ st_shadow_equal (StShadow *shadow, g_return_val_if_fail (shadow != NULL, FALSE); g_return_val_if_fail (other != NULL, FALSE); + if (shadow == other) + return TRUE; + /* We use strict equality to compare double quantities; this means * that, for example, a shadow offset of 0.25in does not necessarily * compare equal to a shadow offset of 18pt in this test. Assume